/**
 * Created with IntelliJ IDEA
 * Description:
 * User: SEKI TOMOKI
 * Date: 2024-08-18
 * Time: 13:04
 */
public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println("结点个数: " + binaryTree.size(root));
        System.out.println("叶子结点个数: " + binaryTree.getLeafNodeCount(root));

        int k = 4;//这棵树的第 k 层
        System.out.println("第 "+ k +" 层叶子结点个数: " +
                binaryTree.getKLevelNodeCount(root, k));

        System.out.println("二叉树的高度是: " + binaryTree.getHeight(root));
        System.out.println("值为 val 的元素是否存在: " +
                binaryTree.find(root, 'E'));

        System.out.print("测试层序遍历: " );
        binaryTree.levelOrder(root);
        System.out.println(binaryTree.isCompleteTree(root));
    }
}
